function filterRoutes(routes, text) {
    // 递归调用
    let arr = routes.filter(item => {
        // 递归出口条件
        return item.auth.includes(text)
    })

    arr.length > 0 && arr.forEach(item => {
        if (item.children) {
            item.children = filterRoutes(item.children, text)
        }
    })
    return arr
}

export {
    filterRoutes
}